An ionic liquid is a liquid material which is entirely composed of ions. Because the ionic liquid remains liquid at room temperature or at a lower temperature (from −97° C. to 100° C.), it is described as a room temperature molten salt or a low temperature molten salt, and also as a liquid organic salt. There are many types of ionic liquids, and according to different organic cations, ionic liquids can be divided into quaternary ammonium salts, quaternary phosphonium salts, nitrogen heterocyclic onium salts etc., wherein the nitrogen heterocyclic type ionic liquids include imidazolium onium salts, pyridinium onium salts, piperidinium salts, pyrrolidine salts etc. In addition, there are various types of anions which could constitute ionic liquids, wherein inorganic anions comprise F−, Cl−, Br−, I−, NO3−, CO32−, PF6−, BF4−, C2O42−, SO42−, PO43−, Al2Cl7− etc., while organic anions comprise CH3COO−, CF3SO3−, C4H9SO3−, CF3COO−, N(CF3SO2)2−, N(C2F5SO2)2−, N(C4F9SO2)2−, N[(CF3SO2)(C4F9SO2)]−, C(CF3SO2)3−, etc. Theoretically speaking, there are more than 1018 kinds of ionic liquids. Structures of cations and anions of several common ionic liquids are as follows:

Recently, extensive research has been conducted on applying ionic liquids into electrolytes of electrochemical power sources, and research of applying ionic liquids as electrolytes of lithium battery systems has been an important branch of electrochemical fields. Electrolyte purity in electrochemical power sources especially in lithium battery systems is strictly required. Generally, content of halogen ions (Cl−, Br−, I−) in electrolytes is under 15 ppm, and that of water in electrolytes is under 80 ppm. If halogen ion residues exist in ionic liquid electrolyte, they will have great influence on the application of ionic liquid electrolyte in secondary batteries. Such halogen ions can corrode battery cases, current collectors, and tabs etc., which will badly affect the charge-discharge efficiency and cycle life of batteries. In addition, if water exists in ionic liquid electrolytes, it will react with lithium electrolyte salts, solvents and active electrode materials, which may lead to battery flatulence or bulge phenomenon etc. In view of the above, in order to yield an ionic liquid with lower halogen ion content, it is necessary to provide a synthesis method whose alkylating agent is not halogenated hydrocarbons. However, taking quaternary ammonium salts as an example, it is conventionally prepared by a reaction between tertiary amines and halogenated hydrocarbons. Such method can only prepare quaternary ammonium salts whose anions are Cl−, Br−, or I−, other quaternary ammonium salts with anions other than Cl−, Br− and I− can only be prepared by an ion exchange reaction. However, such ion exchange reaction will inevitably bring halogen ion residues.
U.S. Pat. No. 4,892,944 describes a method of preparing quaternary ammonium/phosphonium salts using dimethyl carbonate as an alkylating agent. The method includes two steps, in the first step, tertiary amine/phosphine reacts with dimethyl carbonate to generate a quaternary ammonium/phosphonium methyl carbonate; in the second step, the quaternary ammonium/phosphonium methyl carbonate reacts with an acid to release methanol and carbon dioxide, and yields a quaternary ammonium/phosphonium salt. The anion species of the quaternary ammonium/phosphonium salts are determined by the acids used in the second step. The reaction equations are as follows:R1R2R3N(P)+Me2CO3→[R1R2R3N(P)Me]+MeCO3−  (1)[R1R2R3N(P)Me]+MeCO3−+H+A−→[R1R2R3N(P)Me]+A−+MeOH+CO2  (2)
No ion exchange reaction is needed in the method above, in this way, halogen ion residues can be avoided, and the anions of the yielded quaternary ammonium/phosphonium salts derive from anions of various acids. However, in the second step of the method above, when certain anions are introduced by adding acids whose acidity is stronger than that of carbonic acids, moisture will be inevitably brought into final products. For example, in order to yield an ionic liquid whose anion is BF4−, HBF4 aqueous solution is added, thereby water is introduced. Most of the water can be removed by methods of washing, recrystallization or drying, but some moisture residues will remain and it is difficult to be removed completely.
Chinese Patent No. 200610091637.1 discloses an ionic liquid whose content of alkali metal impurity is under 5 ppm while that of the halogen ions is under 1 ppm, and it also discloses a method to synthesize quaternary ammonium/phosphonium salts via acids or esters. However, the anions of the ionic liquids are merely limited to halogenated sulfonyl imide ions. Further, the synthesis process has no moisture control, particularly, the specification describes that water is a preferable solvent, therefore there is no limitation to the content of water in the ionic liquid.
Chinese Patent No. 200710008626.7 discloses a process wherein a dialkyl carbonate reacts with an amine (ammonium) salt at a suitable temperature and a pressure (50° C.˜300° C., 0.5 MPa˜50 MPa, 4˜12 hours) to generate a quaternary ammonium salt. Such process takes the carbonate ester as an alkylating agent, and the hydrogen of the amine salt is substituted by methyl in reaction and thus the quaternary ammonium salt is obtained. The reaction equation is as below:[R1R2R3NH]++Me2CO3→[R1R2R3NMe]++MeOH+CO2  (3)
The process above has no residues of halogen anions. Though such process emphasizes on the synthesis of corresponding quaternary ammonium salt from an amine/ammonium salt, it provides no special synthesis method of such anime/ammonium salt. According to the description of the specification, it takes the products yielded from a neutralization reaction between an amine/ammonia and an acid as reactants, such as NH4+L−, RNH3+L−, R1R2NH2+L−, R1R2R3NH+L−. However, most of the inorganic acids contain water, and as a result moisture will be inevitably introduced during the synthesis of the amine/ammonium salt. Therefore, such problem is still unsolved in the patent, that is, how to synthesis an ionic liquid which has low moisture content.